Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Pull request overview
This PR addresses missing disabled-state visuals for CheckboxControl so a checked+disabled checkbox no longer appears identical to an enabled checkbox (notably in DataForm Storybook scenarios). It adds disabled styling at the component stylesheet level and tweaks a DataForm story to display both boolean control variants together.
Changes:
- Add
:disabled-driven styling toCheckboxControl(opacity + cursor adjustments), including dimming the checkmark icon uniformly. - Update the DataForm “Layout Regular” story to render
can_commentas a toggle and place it next to thestickyboolean field for easier visual comparison.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/components/src/checkbox-control/style.scss | Adds disabled-state cursor handling and dims the entire input container (including SVG icons) when the checkbox input is disabled. |
| packages/dataviews/src/dataform/stories/layout-regular.tsx | Adjusts the boolean field presentation/order in Storybook to show both checkbox and toggle variants together. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Size Change: +205 B (0%) Total Size: 7.74 MB 📦 View Changed
ℹ️ View Unchanged
|
|
Flaky tests detected in da276f1. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24204880620
|
|
Edit: in talking to Lena, we agree to ship this small fixes as an interim fix. The goal is to replace all wordpress/components with wordpress/ui components — and update the disable styles when that happens. |
# Conflicts: # packages/components/CHANGELOG.md
| .components-checkbox-control:not(:has(:disabled)) & { | ||
| cursor: pointer; | ||
| } |
There was a problem hiding this comment.
Tweaking the set up here so it works better with #76786.
|
|
||
| ### Enhancements | ||
|
|
||
| - `RadioControl`: Add support for disabled radio group [#77127](https://github.com/WordPress/gutenberg/pull/77127). |
|
|
||
| &:checked::before { | ||
| border-color: $components-color-gray-300; | ||
| border-color: $components-color-gray-400; |
There was a problem hiding this comment.
Bumping this up a notch in RadioControl because it wasn't dark enough in the general case (like in Checkbox where the icon lines are very thin). It's also closer to the styles we have defined in the new design system.
|
@mirka This PR makes the enabled checkbox gray when disabled (as opposed to using oppacity), and so we'd have this:
What are your thoughts of doing the same for the toggle control (as opposed to using opacity, like this was doing before)? |
|
Oh, I somehow assumed a |
|
|




Follow-up to #77090
What?
Add disabled styles for the
CheckboxControlcomponent.Why?
The
CheckboxControlcomponent had no CSS styles for the:disabledstate. When a checkbox was both checked and disabled, the blue accent background ($components-color-accent) rendered at full opacity, making it visually indistinguishable from an enabled checkbox.This was visible in the DataForm field types boolean story where setting
disabled: truehad no visual effect on the checkbox.How?
:disabledstyles topackages/components/src/checkbox-control/style.scss:opacity: 0.3on.components-checkbox-control__input-container:has(:disabled)to dim both the custom-styled input and the absolutely-positioned SVG checkmark icon uniformly — matching the toggle's disabled opacity.cursor: defaulton the disabled input and on the label (via.components-checkbox-control:has(:disabled)).Edit: 'toggle'for thecan_commentfield and moved it next to thestickycheckbox so both boolean control variants are visible together.Testing Instructions
npm run storybook.True.Use of AI Tools
Claude Code was used to assist with identifying the root cause and implementing the fix.